package com.wwj.framework.utils;

import com.github.pagehelper.Page;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by xya on 16-4-6.
 */
public class Page2EasyUiData {

    public static Map<String, Object> format(Page page) {
        Map<String, Object> map = new HashMap<String, Object>(2);
        map.put("total", page.getTotal());
        map.put("rows", page.getResult());
        return map;
    }

    public static Map<String, Object> format(List list) {
        Map<String, Object> map = new HashMap<String, Object>(2);
        map.put("rows", list);
        map.put("total", list.size());
        return map;
    }

}
